/*
 * @Author: hmhvictory 1400628624@qq.com
 * @Date: 2025-08-01 15:38:11
 * @LastEditors: hmhvictory 1400628624@qq.com
 * @LastEditTime: 2025-08-01 15:44:21
 * @FilePath: \Gitee实训笔记\day15\Homework\test01\Truck.java
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package day15.test01;

public class Truck extends Automobile {
    private String type;
    public Truck(String brand, String plateNumber, String type) {
        super(brand, plateNumber);
        this.type = type;
    }
    @Override
    public int getRent(int days) {
        int dailyRent = 0;
        switch (type) {
            case "小型":
                dailyRent = 300;
                break;
            case "中型":
                dailyRent = 350;
                break;
            case "大型":
                dailyRent = 500;
                break;
        }
        return dailyRent * days;
    }
  
}
